package cf.huzpsb.lias;

import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command;

public class BanCMD extends Command {
    public BanCMD(String name, String permission, String... aliases) {
        super(name, permission, aliases);
    }

    @Override
    public void execute(CommandSender sender, String[] args) {
        if (args.length != 2) {
            sender.sendMessage("§c请使用/lias <账户/ip> <true/false> 来设置封禁状态!");
        } else {
            if (args[1].equals("true")) {
                Main.setstat(args[0], true);
                sender.sendMessage("§c连锁封禁成功!");
            } else if (args[1].equals("false")) {
                Main.setstat(args[0], false);
                sender.sendMessage("§c解除连锁封禁成功!");
            } else {
                sender.sendMessage("§c第2个参数应该是<true>或者<false>!");
            }
        }
    }
}
